1. Field of the Invention
The present invention relates to the field of software proxies and, more particularly, to dynamically inserting proxies into JAVA environments without coding explicit proxy hooks into JAVA applications.
2. Description of the Related Art
In computer science, a proxy can be a software agent or program that performs a function on behalf of another application or system while hiding the underlying details. A proxy can be a communication intermediary injected in a communication pathway involving at least two software/hardware/firmware components, which would otherwise directly communicate with each other. A proxy can be used to insert additional programmatic instructions, routines, decision points, logic flows, and the like within an existing communication flow.
For example, a common use of a proxy is as a software firewall established at an access junction of a network. In the example, the proxy can replace an IP address of a host on an internal or protected network with its own IP address for all traffic passing through it. The proxy can include authentication logic capable of making decisions as to whether or not a user or client IP address is permitted to use the proxy. The proxy can further block potentially hostile incoming traffic from entering a protected network. For instance, the proxy can block excessive communication requests or other potential network overloading behavior that is characteristic of a denial of service attack.
Proxy use is not restricted to network protection situations, however, but can be considered general-purpose software constructs that can be utilized in any of a variety of circumstances. That is, proxies can be used to add new or alternate functionality to an existing software system without modifying the system's existing code. One common use of proxies is to monitor program flow and parameter values, such as during software testing and/or maintenance. Proxies can also be used to collect performance data, processing metrics, and the like, for network planning and dynamic management purposes. For example, an autonomic computing environment can use one or more proxies to detect failures, bottlenecks, or other potential system problems and dynamically route traffic to functional backup nodes.
Currently, JAVA implementations based upon Software Design Kit (SDK) version 1.3 and later utilize the “java.lang.reflect” package that introduces a Proxy Class to the JAVA programming language. A constructor for the Proxy Class is “Proxy(InvocationHandler h)”. This constructor creates a new proxy instance from a subclass with the specified value for an invocation handler. The invocation handler calls an invoke method, “invoke(Object, Method, Object[ ])”, for each method invoke on the proxy object. In the invoke method, the first parameter is the proxy object, the second parameter is the method object representing the method from the interface implemented by the proxy, and the third parameter is the array of parameters passed to the interface method.
A shortcoming of the present implementation of the JAVA Proxy Class is that using the built-in JAVA support, the proxy does not have access to an original interface to which it is hooking unless such access is provided by an application to which the proxy is being hooked. Thus, the currently available built-in proxy support does not afford a means to insert an interface proxy into an existing application without modifying the application. That is, the entire program to which a proxy is to be hooked needs to be rewritten and recompiled in order to accommodate the proxy. This need for application redevelopment and, potentially, redistribution makes using the JAVA Proxy Class to insert an interface proxy in an existing JAVA application an unattractive option.
Further, a JAVA proxy object is not allowed to access the methods the interlace freely. The interface must be explicitly coded to include access for the proxy. In addition to the need for explicit method access, a JAVA proxy object is restricted to the execution of a single method.